using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using System.Data;
using System.Runtime.Remoting;
using System.Collections.Specialized;

//PCS namespaces
using PCSComUtils.Admin.BO;
using PCSComUtils.Admin.DS;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.MasterSetup.DS;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;


namespace PCSUtils.Admin
{
	/// <summary>
	/// Summary description for Login.
	/// </summary>
	public class Login : System.Windows.Forms.Form
	{
		#region Declaration
		
		#region System Generated
		
		private System.Windows.Forms.Label lblUserName;
		private System.Windows.Forms.Label lblPassword;
		private System.Windows.Forms.TextBox txtUser;
		private System.Windows.Forms.TextBox txtPwd;
		private System.ComponentModel.IContainer components;		
		private System.Windows.Forms.PictureBox ptrLogin;
		private System.Windows.Forms.PictureBox ptbBox;
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.PictureBox btnOK;
		private System.Windows.Forms.PictureBox btnCancel;
		private System.Windows.Forms.Button btnOK1;
		private System.Windows.Forms.Button btnCancel1;
		private System.Windows.Forms.ImageList imlImage;
		
		#endregion System Generated
		
		const string CONFIG_FILE = "config.inf";
		const string CONNECTION_STRING = "ConnectionString=";
		private const string THIS = "PCSUtils.Admin.Login";
		public Sys_UserVO pObjobjecVO = new Sys_UserVO();

		#endregion Declaration
		
		#region Constructor, Destructor
	
		public Login()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		
		#endregion Constructor, Destructor
		
		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Login));
            this.lblUserName = new System.Windows.Forms.Label();
            this.txtUser = new System.Windows.Forms.TextBox();
            this.txtPwd = new System.Windows.Forms.TextBox();
            this.lblPassword = new System.Windows.Forms.Label();
            this.ptrLogin = new System.Windows.Forms.PictureBox();
            this.ptbBox = new System.Windows.Forms.PictureBox();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.btnOK = new System.Windows.Forms.PictureBox();
            this.btnCancel = new System.Windows.Forms.PictureBox();
            this.btnOK1 = new System.Windows.Forms.Button();
            this.btnCancel1 = new System.Windows.Forms.Button();
            this.imlImage = new System.Windows.Forms.ImageList(this.components);
            ((System.ComponentModel.ISupportInitialize)(this.ptrLogin)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.ptbBox)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.btnOK)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.btnCancel)).BeginInit();
            this.SuspendLayout();
            // 
            // lblUserName
            // 
            resources.ApplyResources(this.lblUserName, "lblUserName");
            this.lblUserName.ForeColor = System.Drawing.Color.Black;
            this.lblUserName.Name = "lblUserName";
            // 
            // txtUser
            // 
            resources.ApplyResources(this.txtUser, "txtUser");
            this.txtUser.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(227)))), ((int)(((byte)(227)))));
            this.txtUser.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtUser.Name = "txtUser";
            this.txtUser.Enter += new System.EventHandler(this.txtUser_Enter);
            // 
            // txtPwd
            // 
            resources.ApplyResources(this.txtPwd, "txtPwd");
            this.txtPwd.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(227)))), ((int)(((byte)(227)))), ((int)(((byte)(227)))));
            this.txtPwd.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtPwd.Name = "txtPwd";
            this.txtPwd.Enter += new System.EventHandler(this.txtPwd_Enter);
            // 
            // lblPassword
            // 
            resources.ApplyResources(this.lblPassword, "lblPassword");
            this.lblPassword.ForeColor = System.Drawing.Color.Black;
            this.lblPassword.Name = "lblPassword";
            // 
            // ptrLogin
            // 
            resources.ApplyResources(this.ptrLogin, "ptrLogin");
            this.ptrLogin.Name = "ptrLogin";
            this.ptrLogin.TabStop = false;
            // 
            // ptbBox
            // 
            resources.ApplyResources(this.ptbBox, "ptbBox");
            this.ptbBox.Name = "ptbBox";
            this.ptbBox.TabStop = false;
            // 
            // pictureBox1
            // 
            resources.ApplyResources(this.pictureBox1, "pictureBox1");
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.TabStop = false;
            // 
            // btnOK
            // 
            resources.ApplyResources(this.btnOK, "btnOK");
            this.btnOK.Name = "btnOK";
            this.btnOK.TabStop = false;
            this.btnOK.Click += new System.EventHandler(this.btnOk_Click);
            this.btnOK.MouseEnter += new System.EventHandler(this.btnOK_MouseEnter);
            this.btnOK.MouseLeave += new System.EventHandler(this.btnOK_MouseLeave);
            // 
            // btnCancel
            // 
            resources.ApplyResources(this.btnCancel, "btnCancel");
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.TabStop = false;
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            this.btnCancel.MouseEnter += new System.EventHandler(this.btnCancel_MouseEnter);
            this.btnCancel.MouseLeave += new System.EventHandler(this.btnCancel_MouseLeave);
            // 
            // btnOK1
            // 
            resources.ApplyResources(this.btnOK1, "btnOK1");
            this.btnOK1.Name = "btnOK1";
            this.btnOK1.Click += new System.EventHandler(this.btnOk_Click);
            this.btnOK1.Enter += new System.EventHandler(this.btnOK1_Enter);
            this.btnOK1.Leave += new System.EventHandler(this.btnOK1_Leave);
            // 
            // btnCancel1
            // 
            resources.ApplyResources(this.btnCancel1, "btnCancel1");
            this.btnCancel1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel1.Name = "btnCancel1";
            this.btnCancel1.Click += new System.EventHandler(this.btnCancel_Click);
            this.btnCancel1.Enter += new System.EventHandler(this.btnCancel1_Enter);
            this.btnCancel1.Leave += new System.EventHandler(this.btnCancel1_Leave);
            // 
            // imlImage
            // 
            this.imlImage.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imlImage.ImageStream")));
            this.imlImage.TransparentColor = System.Drawing.Color.Transparent;
            this.imlImage.Images.SetKeyName(0, "");
            this.imlImage.Images.SetKeyName(1, "");
            this.imlImage.Images.SetKeyName(2, "");
            this.imlImage.Images.SetKeyName(3, "");
            // 
            // Login
            // 
            this.AcceptButton = this.btnOK1;
            resources.ApplyResources(this, "$this");
            this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(234)))), ((int)(((byte)(234)))), ((int)(((byte)(234)))));
            this.CancelButton = this.btnCancel1;
            this.Controls.Add(this.btnCancel);
            this.Controls.Add(this.ptrLogin);
            this.Controls.Add(this.lblPassword);
            this.Controls.Add(this.txtPwd);
            this.Controls.Add(this.txtUser);
            this.Controls.Add(this.lblUserName);
            this.Controls.Add(this.ptbBox);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.btnOK);
            this.Controls.Add(this.btnCancel1);
            this.Controls.Add(this.btnOK1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.KeyPreview = true;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Login";
            this.Closed += new System.EventHandler(this.Login_Closed);
            this.Load += new System.EventHandler(this.Login_Load);
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Login_KeyDown);
            ((System.ComponentModel.ISupportInitialize)(this.ptrLogin)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.ptbBox)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.btnOK)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.btnCancel)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

		}

		#endregion

		#region Class's Method

		#region Change backcolor when focus or lost focus
		
		private void OnEnterControl(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ". OnEnterControl()";
			try
			{
				FormControlComponents.OnEnterControl(sender, e);
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}

		private void OnLeaveControl(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ". OnLeaveControl()";
			try
			{
				FormControlComponents.OnLeaveControl(sender, e);
			}
			catch (Exception ex)
			{
				// displays the error message.
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
				// log message.
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
				}
			}
		}
		#endregion

				
		
		//**************************************************************************
		/// <summary>
		/// Check mandatory control
		/// </summary>
		/// <param name="pobjControl"></param>
		/// <returns></returns>
		/// <Author> Tuan DM, Jan 10, 2005</Author>
		private bool CheckMandatory(Control pobjControl)
		{
			if (pobjControl.Text.Trim() == string.Empty)
			{
				return false;
			}
			return true;
		}
		
		//**************************************************************************		
		/// <summary>
		/// Validate all control and message warning
		/// </summary>
		/// <returns></returns>
		/// <Author> Tuan DM, Jan 10, 2005</Author>
		private bool ValidateData() 
		{
			// check data in textboxes
			if (!CheckMandatory(txtUser))
			{
				PCSMessageBox.Show(ErrorCode.LOGIN_MANDATORY_INVALID);
				txtUser.Focus();
				txtUser.SelectAll();
				return false;					
			}
			if (!CheckMandatory(txtPwd))
			{
				PCSMessageBox.Show(ErrorCode.LOGIN_MANDATORY_INVALID);
				txtPwd.Focus();
				txtPwd.SelectAll();
				return false;
			}
			return true;
		}
		
		//**************************************************************************
		/// <summary>
		/// Authenticate user 
		/// </summary>
		/// <param name="pobjObjecVO">pobjObjecVO contain username and password of user</param>
		/// <returns></returns>
		/// <Author> Tuan DM, Jan 10, 2005</Author>
		private Sys_UserVO CheckAuthenticate(Sys_UserVO pobjObjecVO)
		{
			CommonBO boCommon = new CommonBO();
			try
			{
							
				Sys_UserVO sysUserVO= new Sys_UserVO();
				object obj = (object) pobjObjecVO;
				sysUserVO=(Sys_UserVO)boCommon.CheckAuthenticate(obj);
								
				return sysUserVO;
			}
			catch (PCSException ex)
			{
				throw ex;
			}
			catch (Exception ex1)
			{
				throw ex1;
			}

		}
		
		#endregion Class's Method
		
		#region Event Processing

		private void Login_Load(object sender, System.EventArgs e)
		{
			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.WaitCursor;

			#endregion Code Inserted Automatically					

			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.Default;

			#endregion Code Inserted Automatically

			
		}		
		
		/// <summary>
		/// Event for Ok click
		/// If user's information is correct then login system else then messages
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		/// <Author> Tuan DM, Jan 10, 2005</Author>
		private void btnOk_Click(object sender, System.EventArgs e)
		{
			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.WaitCursor;

			#endregion Code Inserted Automatically

			
			const string METHOD_NAME = THIS + "btnOk_Click()";
			const string HOME_CURRENCY = "HomeCurrency";
			const string EMPLOYEE_NAME = "EmployeeName";
			const string MASTERLOCATIONCODE = "MasterLocationCode";
			const string MASTERLOCATIONNAME = "MasterLocationName";

			pObjobjecVO = new Sys_UserVO();
			
            if (ValidateData())
			{
				pObjobjecVO.UserName = txtUser.Text.Trim();
				pObjobjecVO.Pwd = txtPwd.Text.Trim();
				try
				{
                    DataSet dstData = (new UtilsBO()).GetDefaultInfomation();
                    ErrorMessage.dsErrorMessage = dstData.Tables[Sys_Error_MsgTable.TABLE_NAME];

					Sys_UserVO sysUserVO = new Sys_UserVO();				
					sysUserVO= CheckAuthenticate(pObjobjecVO);
					CommonBO boCommon = new CommonBO();
					// HACK: Trada 14-12-2005
					DataSet dstRoleAndParam = boCommon.ListRoleAndSysParam(sysUserVO.UserID, pObjobjecVO.UserName);
					//check if no-right assigned
					if (dstRoleAndParam.Tables[0].Rows.Count == 0)
					{
						PCSMessageBox.Show(ErrorCode.MESSAGE_NORIGHT_LOGIN,MessageBoxButtons.OK);
						txtUser.SelectionStart = 0;
						txtUser.SelectionLength = txtUser.Text.Length;
						txtUser.Focus();
						return;
					}

					pObjobjecVO = new Sys_UserVO();
					pObjobjecVO = sysUserVO;
					SystemProperty.ExecutablePath = Application.StartupPath;
					SystemProperty.UserID = pObjobjecVO.UserID;
					SystemProperty.UserName = pObjobjecVO.UserName;
					// Get the first Role
					SystemProperty.RoleID = int.Parse(dstRoleAndParam.Tables[0].Rows[0][Sys_RoleTable.ROLEID_FLD].ToString());
					//Set SystemProperties
					DataRow drowMST_CCN = dstRoleAndParam.Tables[1].Rows[0];
					SystemProperty.CCNID = int.Parse(drowMST_CCN[MST_CCNTable.CCNID_FLD].ToString());
					SystemProperty.CCNCode = drowMST_CCN[MST_CCNTable.CODE_FLD].ToString();
					SystemProperty.CCNDescription = drowMST_CCN[MST_CCNTable.DESCRIPTION_FLD].ToString();
                    
					if (drowMST_CCN[MST_CCNTable.CITYID_FLD].ToString() != string.Empty)
					{
						SystemProperty.CityID = int.Parse(drowMST_CCN[MST_CCNTable.CITYID_FLD].ToString());
					}
					else 
						SystemProperty.CityID = 0;
					SystemProperty.Code = drowMST_CCN[MST_CCNTable.CODE_FLD].ToString();
					if (drowMST_CCN[MST_CCNTable.CITYID_FLD].ToString() != string.Empty)
					{
						SystemProperty.CountryID = int.Parse(drowMST_CCN[MST_CCNTable.COUNTRYID_FLD].ToString());
					}
					else 
						SystemProperty.CountryID = 0;
					if (drowMST_CCN[MST_CCNTable.DEFAULTCURRENCYID_FLD].ToString() != string.Empty)
					{
						SystemProperty.DefaultCurrencyID = int.Parse(drowMST_CCN[MST_CCNTable.DEFAULTCURRENCYID_FLD].ToString());
					}
					SystemProperty.Description = drowMST_CCN[MST_CCNTable.DESCRIPTION_FLD].ToString();
					SystemProperty.Email = drowMST_CCN[MST_CCNTable.EMAIL_FLD].ToString();
					if (drowMST_CCN[MST_CCNTable.EXCHANGERATE_FLD].ToString() != string.Empty)
					{
						SystemProperty.ExchangeRate = float.Parse(drowMST_CCN[MST_CCNTable.EXCHANGERATE_FLD].ToString());
					}
					else 
						SystemProperty.ExchangeRate = 0;
					SystemProperty.ExchangeRateOperator = drowMST_CCN[MST_CCNTable.EXCHANGERATEOPERATOR_FLD].ToString();
					SystemProperty.Fax = drowMST_CCN[MST_CCNTable.FAX_FLD].ToString();
					if (drowMST_CCN[MST_CCNTable.HOMECURRENCYID_FLD].ToString() != string.Empty)
					{
						SystemProperty.HomeCurrencyID = int.Parse(drowMST_CCN[MST_CCNTable.HOMECURRENCYID_FLD].ToString());
					}
					else
						SystemProperty.HomeCurrencyID = 0;
					SystemProperty.HomeCurrency = drowMST_CCN[HOME_CURRENCY].ToString();
					SystemProperty.Name = drowMST_CCN[MST_CCNTable.NAME_FLD].ToString();
					SystemProperty.Phone = drowMST_CCN[MST_CCNTable.PHONE_FLD].ToString();
					SystemProperty.State = drowMST_CCN[MST_CCNTable.STATE_FLD].ToString();
					SystemProperty.VAT = drowMST_CCN[MST_CCNTable.VAT_FLD].ToString();
					SystemProperty.WebSite = drowMST_CCN[MST_CCNTable.WEBSITE_FLD].ToString();
					SystemProperty.ZipCode = drowMST_CCN[MST_CCNTable.ZIPCODE_FLD].ToString();
					if (drowMST_CCN[MST_EmployeeTable.EMPLOYEEID_FLD].ToString() != string.Empty)
					{
						SystemProperty.EmployeeID = int.Parse(drowMST_CCN[MST_EmployeeTable.EMPLOYEEID_FLD].ToString());
					}
					else
						SystemProperty.EmployeeID = 0;
					SystemProperty.EmployeeName = drowMST_CCN[EMPLOYEE_NAME].ToString();
					SystemProperty.MasterLocationID = int.Parse(drowMST_CCN[MST_MasterLocationTable.MASTERLOCATIONID_FLD].ToString());
					SystemProperty.MasterLocationCode = drowMST_CCN[MASTERLOCATIONCODE].ToString();
					SystemProperty.MasterLocationName = drowMST_CCN[MASTERLOCATIONNAME].ToString();
					// get all system parameters
					NameValueCollection objParam = new NameValueCollection();
					// put to Collection
					foreach (DataRow drowData in dstRoleAndParam.Tables[2].Rows)
						objParam.Add(drowData[Sys_ParamTable.NAME_FLD].ToString().Trim(), drowData[Sys_ParamTable.VALUE_FLD].ToString().Trim());
					SystemProperty.SytemParams = objParam;
					// set the report logo file name
					SystemProperty.LogoFile = Application.StartupPath + @"\logo.jpg";

				    SystemProperty.TransactionType = Utilities.Instance.GetTransactionTypes();
					
					this.DialogResult = DialogResult.OK;

					// HACKED: 23/05/2006 Thachnn : Delete Temporary PCS Report File
					string mstrReportDefFolder = Application.StartupPath + "\\" +Constants.REPORT_DEFINITION_STORE_LOCATION;					
					FormControlComponents.DeletePCSTempReportFile(mstrReportDefFolder);					
					// ENDHACKED: 23/05/2006 Thachnn : Delete Temporary PCS Report File

					this.Close();
				}
				catch (PCSException ex)
				{
					PCSMessageBox.Show(ex.mCode);
					try
					{
						Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
					}
					txtUser.SelectionStart = 0;
					txtUser.SelectionLength = txtUser.Text.Length;
					txtUser.Focus();
				}
				catch (Exception ex)
				{
					PCSMessageBox.Show(ErrorCode.OTHER_ERROR);
					try
					{
						Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION);
					}
				}
			}

			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.Default;

			#endregion Code Inserted Automatically

			
		}

		private void btnCancel_Click(object sender, System.EventArgs e)
		{
			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.WaitCursor;

			#endregion Code Inserted Automatically

			
			Application.Exit();

			// Code Inserted Automatically

			#region Code Inserted Automatically

			this.Cursor = Cursors.Default;

			#endregion Code Inserted Automatically

			
		}

		private void Login_Closed(object sender, System.EventArgs e)
		{
			if (this.DialogResult != DialogResult.OK)
			{
				Application.Exit();
			}
		}
		
		private void btnOK_MouseEnter(object sender, System.EventArgs e)
		{
			btnOK.Image = imlImage.Images[1];
			btnCancel.Image = imlImage.Images[2];
		}

		private void btnOK1_Enter(object sender, System.EventArgs e)
		{
			btnOK.Image = imlImage.Images[1];
		}

		private void btnCancel1_Enter(object sender, System.EventArgs e)
		{
			btnCancel.Image = imlImage.Images[3];
			btnOK.Image = imlImage.Images[0];
		}

		private void txtUser_Enter(object sender, System.EventArgs e)
		{
			btnCancel.Image = imlImage.Images[2];
			txtUser.SelectionStart = 0;
			txtUser.SelectionLength = txtUser.Text.Length;
		}

		private void btnOK_MouseLeave(object sender, System.EventArgs e)
		{
			btnOK.Image = imlImage.Images[0];	
		}

		private void btnCancel_MouseEnter(object sender, System.EventArgs e)
		{
			btnCancel.Image = imlImage.Images[3];
			btnOK.Image = imlImage.Images[0];
		}

		private void btnCancel_MouseLeave(object sender, System.EventArgs e)
		{
			//btnCancel.Image = imlImage.Images[2];
		}

		private void btnOK1_Leave(object sender, System.EventArgs e)
		{
			btnOK.Image = imlImage.Images[0];
		}

		private void btnCancel1_Leave(object sender, System.EventArgs e)
		{
			btnCancel.Image = imlImage.Images[2];
		}

		private void txtPwd_Enter(object sender, System.EventArgs e)
		{
			txtPwd.SelectionStart = 0;
			txtPwd.SelectionLength = txtPwd.Text.Length;
		}

		private void Login_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if ((e.KeyCode == Keys.F1) && (e.Modifiers == Keys.Control))
			{
				ConnectionMaintainance frmConnMaintainance = new ConnectionMaintainance();
				frmConnMaintainance.ShowDialog(this);
			}
		}

		#endregion Event Processing

	}
}
					